package a4;

public class WordPosPair implements Comparable{
	public String word;
	public String pos;
	
	public WordPosPair(String word, String pos){
		this.word = word;
		this.pos = pos;
	}
	
	public boolean equals(Object other){
		if(word == ((WordPosPair)other).word && pos == ((WordPosPair)other).pos){
			return true;
		}else{
			return false;
		}
	}
	public int compareTo(Object other){
	    if(word == ((WordPosPair)other).word && pos == ((WordPosPair)other).pos)
	        return 0;
	    else if (word == ((WordPosPair)other).word && pos.compareTo(((WordPosPair)other).pos) == 1)
	        return 1;
	    else if (word == ((WordPosPair)other).word && pos.compareTo(((WordPosPair)other).pos) == -1)
	        return -1;
	    else if (word.compareTo(((WordPosPair)other).word) == 1)
	        return 1;
	    else 
	        return -1;
	}
}
